package com.example.car.bean

import android.os.Parcel
import android.os.Parcelable

data class NewsListBean(
    var error_code: Int = 0, // 0
    var reason: String? = "", // success
    var result: Result = Result()
) {

    data class Result(
        var `data`: List<Data> = listOf(),
        var page: String = "", // 1
        var pageSize: String = "", // 3
        var stat: String = "" // 1
    ) {
        data class Data(
            var author_name: String? = "", // 鲁网
            var category: String? = "", // 头条
            var date: String? = "", // 2021-03-08 13:47:00
            var is_content: String? = "", // 1
            var thumbnail_pic_s: String? = "", // https://dfzximg02.dftoutiao.com/news/20210308/20210308134708_d0216565f1d6fe1abdfa03efb4f3e23c_0_mwpm_03201609.png
            var thumbnail_pic_s02: String? = "", // https://dfzximg02.dftoutiao.com/news/20210308/20210308134708_d0216565f1d6fe1abdfa03efb4f3e23c_1_mwpm_03201609.png
            var thumbnail_pic_s03: String? = "", // https://dfzximg02.dftoutiao.com/news/20210308/20210308134708_d0216565f1d6fe1abdfa03efb4f3e23c_2_mwpm_03201609.png
            var title: String? = "", // “新时代女性的自我关爱”主题沙龙暨双山街道福泰社区妇儿活动家园启动仪式举行
            var uniquekey: String? = "", // db61b977d9fabd0429c6d0c671aeb30e
            var url: String? = "" // https://mini.eastday.com/mobile/210308134708834241845.html
        ) : Parcelable {
            constructor(parcel: Parcel) : this(
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString(),
                parcel.readString()
            ) {
            }

            override fun writeToParcel(parcel: Parcel, flags: Int) {
                parcel.writeString(author_name)
                parcel.writeString(category)
                parcel.writeString(date)
                parcel.writeString(is_content)
                parcel.writeString(thumbnail_pic_s)
                parcel.writeString(thumbnail_pic_s02)
                parcel.writeString(thumbnail_pic_s03)
                parcel.writeString(title)
                parcel.writeString(uniquekey)
                parcel.writeString(url)
            }

            override fun describeContents(): Int {
                return 0
            }

            companion object CREATOR : Parcelable.Creator<Data> {
                override fun createFromParcel(parcel: Parcel): Data {
                    return Data(parcel)
                }

                override fun newArray(size: Int): Array<Data?> {
                    return arrayOfNulls(size)
                }
            }

        }
    }
}